<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/style.css" />
    <script type="text/javascript" src="__PUBLIC__/Js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/bootstrap.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/ckform.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/common.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form class="form-inline definewidth m20" action="<?php echo U('index');?>" method="post">

</form>
<div style="margin-left:35px;">
<a href="__GROUP__/Fenlei/add"><button>添加分类</button></a>
</div>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th>ID</th>
        <th>类型名称</th>
        <th>编号</th>
        <th>链接</th>
        <th>状态</th>
      </tr>
    </thead>
        <?php if(is_array($fenlei)): $i = 0; $__LIST__ = $fenlei;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
            <td><?php echo ($vo["id"]); ?></td>
            <td><?php echo ($vo["title"]); ?></td>
            <td><?php echo ($vo["number"]); ?></td>
            <td><?php echo ($vo["chain"]); ?></td>
            <td><?php if($vo["status"] == 0): ?><a href="__GROUP__/Fenlei/status/id/<?php echo ($vo["id"]); ?>">
            <span style = "color:red;">停用</span></a>
            <?php else: ?><a href="__GROUP__/Fenlei/status/id/<?php echo ($vo["id"]); ?>">启用</a><?php endif; ?></td>
            <input type="hidden" name="fenleiID" value="<?php echo ($vo["id"]); ?>"/>
          </tr><?php endforeach; endif; else: echo "" ;endif; ?>
</table>
</body>
</html>
<script>
    function adduser(){
        window.location.href="add.html";
    }

    $(function () {
		$('#addnew').click(function(){
				window.location.href="<?php echo U('User/adduser');?>";
		 });
    });
	function del(id)
	{
		if(confirm("确定要删除吗？"))
		{
			var url = "<?php echo U('User/deleteuser');?>?uid="+id;
			window.location.href=url;
		}
	}
</script>